<template>
    <div>
        {{user}}
      <el-form :model="user"  ref="user" label-width="80px;" class="login-box">
        <h3>修改信息</h3>
       
        <el-form-item label="用户名">
         <el-input v-model="user.userName" placeholder="用户名不能为空"></el-input>

        </el-form-item>
          <el-form-item label="用户名">
         <el-input v-model="user.userCode" placeholder="用户名不能为空"></el-input>

        </el-form-item>
      </el-form>
   

    </div>
</template>

<script>
    export default {
         name: "UserInfo",
         props:['username','id'],

         data () {
             return {
                 user: ""        
                 ,
             }
         },
     
  /* 进入之前*/
  beforeRouteEnter: (to, from, next) => {
        next(vm => {
        vm.getData();
    });

  },
  methods: {
                
      getData:function () {
          let id= this.$store.state.user.id;
              this.$axiosGet("/api-user/find/"+id,null).then(result=>{
               this.user=result.data.data;
          })
      }
  }

    }
</script>

<style scoped>
.login-box {
  width: 450px;
  margin: 20px auto;
  border: 1px solid #dcdfe6;
  padding: 35px;
  border-radius: 5px;
  box-shadow: 0 0 25px #dcdfe6;
}
.login-title {
  text-align: center;
}
</style>
